/*
	Copyright 2010-2012 Tommaso Previero
	
	This file is part of TeXdocGraphic.

	TeXdocGraphic is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	TeXdocGraphic is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with TeXdocGraphic.  If not, see <http://www.gnu.org/licenses/>.
	
	Created:		12/05/2012

*/

package it.texdocgraphic.logger;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Date;

public class SimpleLogger {
	private static PrintStream ps = null;
	static {
		try {
			boolean created = (new File(System.getProperty("user.home") + File.separator + ".tg")).mkdir();
			ps = new PrintStream(new FileOutputStream(System.getProperty("user.home") + File.separator + ".tg" + File.separator + "tg.log"));
			log("Created log file");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	};
	public static void log(String message) {
		ps.print("["+(new Date()).toString()+"] - ");
		ps.println(message);
	}
}
